<?php
@session_start ();
if(!isset($_SESSION['username'])) {
	header("location:log_in.php");
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<link rel="stylesheet" href="../u_css/credit_info.css"/>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>更改密码</title>
</head>
<body>
<?php
require '../mysql_connection/for_u_lijinsheng.php';
include '../include_htmls/header.php';
?>
<div id="body">
<?php
if (isset ( $_GET ['username'] )) {
	$last_username = $_GET ['username'];
	$account_number = $_GET ['account_number'];
	$new_account = array ();
	for($i = 0; $i < $account_number; $i ++) {
		$new_account [$i] = $_GET [('account' . $i)];
		unset ( $_GET [('account' . $i)] );
	}
	change_bank_account ( $last_username, $new_account );
	unset ( $_GET ['username'] );
	unset ( $_GET ['account_number'] );
}
if (isset ( $_SESSION ['username'] )) {
	$username = $_SESSION ['username'];
	$bank_Info = get_Bank_Info ( $username );
	?>
<div id="left-navigation">
<ul>
	<li><a class="unclick" href="base_Info.php">基本信息</a></li>
	<li><a class="unclick" href="chang_password.php">修改密码</a></li>
	<li class="current">账户信息</li>
</ul>
</div>

<div id="content">
<h1>银行帐号信息</h1>
<form action="credit_Info.php" method="get">
<div><input type="hidden" name="username" value="<?=$username?>" /> <input
	type="hidden" name="account_number" value="<?=count ( $bank_Info )?>" /> 
<?php
	for($i = 0; $i < count ( $bank_Info ); $i ++) {
		$account = $bank_Info [$i];
		?>
		<label><input type="text" name="account<?=$i?>" /><?=$account?></label>
<?php
	}
	?>
<input type="submit" value="保存银行帐号"/></div>
</form>
</div>
<?php
}
?>
</div>
<?php
include '../include_htmls/footer.html';
?>


</body>
</html>
